package com.zy.order;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.EnableFeignClients;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

import javax.annotation.PostConstruct;

/**
 * @author 这是那头猪？
 * @version 1.0
 * @description: TODO
 * @date 2023/5/30 14:47
 */
@MapperScan(basePackages = {"com.zy.order.mapper"})
@EnableFeignClients(basePackages = "com.zy.order.client")
@EnableSwagger2WebMvc
@SpringBootApplication
public class OrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }
    //
    // //在bean初始化的时候，加载下面的规则
    // @PostConstruct
    // private static void initFlowRules(){
    //     List<FlowRule> rules = new ArrayList<>();
    //     FlowRule rule = new FlowRule();
    //     rule.setResource("HelloWorld");
    //     rule.setGrade(RuleConstant.FLOW_GRADE_QPS);
    //     // Set limit QPS to 20.
    //     rule.setCount(20);
    //     rules.add(rule);
    //     FlowRuleManager.loadRules(rules);
    // }
}
